<!-- <page-header-wrapper [title]="'开票申请'"> </page-header-wrapper>
<nz-card class="search-box" nzBordered>
  <div nz-row nzGutter="8">
    <div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
      <sf #sf [schema]="searchSchema" [ui]="{ '*': { spanLabelFixed: 90, grid: { lg: 8, md: 12, sm: 12, xs: 24 } } }"
        [compact]="true" [button]="'none'"></sf>
    </div>
    <div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right">
      <button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
      <button nz-button (click)="resetSF()">重置</button>
      <button nz-button (click)="exprot()" acl  [acl-ability]="['TICKET-INVOICE-REQUESTED-export']"> 导出</button>
      <button nz-button nzType="link" (click)="expandToggle()">
        {{ !_$expand ? '展开' : '收起' }}
        <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
      </button>
    </div>
  </div>
</nz-card> -->
<nz-card class="table-box">
  <div class="tab_header">
    <label class="page_title">
      <label class="driver">|</label>
      开票申请</label>
    <nz-tabset [nzTabBarExtraContent]="extraTemplate">
      <nz-tab nzTitle="待受理" (nzClick)="selectChange('1')"></nz-tab>
      <nz-tab nzTitle="处理中" (nzClick)="selectChange('2')"></nz-tab>
      <nz-tab nzTitle="已拒绝" (nzClick)="selectChange('4')"></nz-tab>
      <nz-tab nzTitle="已撤销" (nzClick)="selectChange('5')"></nz-tab>
      <nz-tab nzTitle="已完成" (nzClick)="selectChange('3')"></nz-tab>
      <nz-tab nzTitle="全部" (nzClick)="selectChange(null)"></nz-tab>
    </nz-tabset>
  </div>

  <ng-template #extraTemplate>
    <div class="d-flex align-items-center mr-sm"
      *ngIf="resourceStatus==='1'|| resourceStatus==='2' || resourceStatus==='3' || !resourceStatus">
      <div class="mr-md">
        已选择
        <strong class="text-red">{{ selectedRows.length }}</strong> 条数据&nbsp;&nbsp; 开票金额总计
        <strong class="text-red">{{ totalCallNo }}</strong>
        <a *ngIf="totalCallNo > 0" (click)="st.clearCheck();totalCallNo=0" class="ml-lg">清空</a>
      </div>
      <button nz-button nzDanger [nzLoading]="service.http.loading" (click)="openDrawer()">筛选</button>
      <button nz-button nzDanger (click)="exprot()" acl [acl-ability]="['TICKET-INVOICE-REQUESTED-export']"> 导出</button>
      <button nz-button nz-dropdown [nzDropdownMenu]="menu" nzPlacement="bottomLeft">
        更多<i nz-icon nzType="down" nzTheme="outline"></i></button>
      <nz-dropdown-menu #menu="nzDropdownMenu">
        <ul nz-menu>
          <li nz-menu-item *ngIf="resourceStatus==='1' || !resourceStatus" (click)="this.batchRequested()" acl
            [acl-ability]="['TICKET-INVOICE-REQUESTED-userApply']">
            批量受理
          </li>
          <li nz-menu-item *ngIf="resourceStatus==='1' || !resourceStatus" (click)="this.rejectAction(selectedRows)" acl
            [acl-ability]="['TICKET-INVOICE-REQUESTED-reject']">
            驳回
          </li>
          <li nz-menu-item *ngIf="resourceStatus !=='4' && resourceStatus !=='5'" (click)="changeAddress(selectedRows)"
            acl [acl-ability]="['VEHICLE-LIST-search']">
            修改地址
          </li>
          <li nz-menu-item *ngIf="resourceStatus==='3' || !resourceStatus" (click)="printOrder(selectedRows)" acl
            [acl-ability]="['VEHICLE-LIST-search']">
            快递下单
          </li>
        </ul>
      </nz-dropdown-menu>
    </div>
  </ng-template>

  <st #st [data]="service.$api_get_invoice_requested_page" [columns]="columns" [req]="{ process: beforeReq }"
    [page]="{}" [res]="{  process: afterRes }" [loading]="false" [scroll]="{ x: '1200px',y:scrollY }" (change)="stChange($event)">
    <ng-template st-row="vatappcode" let-item let-index="index" let-column="column">
      {{ item.vatappcode }} <br />
      <label class="text-primary">{{item.stsLabel}}</label>
    </ng-template>
  </st>
</nz-card>

<ng-template #rejectModal>
  <div nz-row nzGutter="8">
    <div nz-col nzSpan="24" se-container [labelWidth]="80">
      <se [col]="1" label="备注" required>
        <textarea nz-input rows="3" [(ngModel)]="rejectReason" placeholder="请说明驳回原因"
          style="width: 325px; margin-left: 14px"></textarea>
      </se>
    </div>
  </div>
</ng-template>